#include <iostream>
#include <windows.h>
using namespace std;

class CLOCK
{
private:
	int Hour;
	int Minute;
	int Seconde;

public:
	void Set(int h, int m, int s)
	{
		Hour = h;
		Minute = m;
		Seconde = s;
	}
	void Run();
	void Show()
	{
		cout << Hour << "." << Minute << "." << Seconde;
	}

	// 构造函数
	CLOCK()
	{ //默认构造函数，类内定义
		Hour = 0;
		Minute = 0;
		Seconde = 0;
	}

	CLOCK(CLOCK &b)
	{
		Hour = b.Hour;
		Minute = b.Minute;
		Seconde = b.Seconde;
	}

	CLOCK(int h, int m, int s)
	{
		Hour = h;
		Minute = m;
		Seconde = s;
	}
};

void CLOCK::Run()
{
	for (int i = 0; i < 10; i++)
	{
		Seconde++;
		if (Seconde == 60)
		{
			Seconde = 0;
			Minute++;
			if (Minute == 60)
			{
				Minute = 0;
				Hour++;
				if (Hour == 24)
				{
					Hour = 0;
				}
			}
		}
		cout << '\r';
		Sleep(1000);
		Show();
	}
}

int main()
{
	CLOCK c1;
	c1.Set(0, 0, 0);
	c1.Show();
	c1.Run();
	c1.Set(1, 1, 30);
	c1.Run();
	cout << endl;
	c1.Show();

	CLOCK c2(2, 3, 4);
	c2.Set(0, 0, 0);
	c2.Show();
	c2.Run();
	c2.Set(1, 1, 30);
	c2.Run();
	cout << endl;
	c2.Show();
	return 0;
}
